/*****************************************************************************
 * mysql.h
 *
 * Copyright (C) 2020 Jeasonvor 1101627719@qq.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 ****************************************************************************/
#ifndef __DEV_MYSQL_H__
#define __DEV_MYSQL_H__

/*****************************************************************************
 * Included Files
 ****************************************************************************/

/*****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/*****************************************************************************
 * Public Types
 ****************************************************************************/
typedef void *  dev_mysql_hdl_t;
/*****************************************************************************
 * Public Data
 ****************************************************************************/

/****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

/**
 * @brief:  连接MySQL数据库
 * 
 * @param[in]: host     -   MySQL主机名称
 * @param[in]: port     -   端口
 * @param[in]: usr      -   用户名
 * @param[in]: passwd   -   密码
 * @param[in]: db       -   数据库名称
 * 
 * @return: 返回mysql连接句柄
 */
dev_mysql_hdl_t    dev_mysql_connect(plum_s8 *host,plum_u32 port,
                            plum_s8 *usr,plum_s8 *passwd,
                            plum_s8 *db);

/**
 * @brief:  断开MySQL连接
 * 
 * @param[in]:  hdl     -   连接句柄 
 * 
 * @return:     返回执行状态
 */
plum_void     dev_mysql_discon(dev_mysql_hdl_t hdl);

/**
 * @brief:  MySQL执行select指令
 * 
 * @param[in]: hdl  -   mysql连接句柄
 * @param[in]: cmd  -   命令
 *  
 * @return：返回执行状态
 */
plum_s32    dev_mysql_select(dev_mysql_hdl_t hdl,plum_s8 *cmd);


/****************************************************************************/
#ifdef __cplusplus
}
#endif
/****************************************************************************/
#endif /* __DEV_MYSQL_H__ */
/****************************************************************************/
/*                                                                          */
/*  End of file.                                                            */
/*                                                                          */
/****************************************************************************/
